import type { MutipleType } from '@/types'

export interface FILE {
	type?: string
	url: string
	name?: string
	id?: string
}

export interface LevelItem extends ServiceTimeForm {
	id: MutipleType;
	label: string;
	way: string[];
	desc: string;
	serviceTime: ServiceTimeForm;
}

export interface CareServiceFormState {
	name: string;
	icon: string;
	tag: string[];
	levels: string[];
	levelsInfo: LevelItem[];
	case?: FILE[];
}

export interface CareServiceDetail {
	ID: number
	Name: string;
	Icon: string;
	Tag: EnumItem;
	Video: string
	Pictures: string[]
	Levels: Array<{
		Way: EnumItem;
		Desc: string;
		ID: number;
		Level: EnumItem;
		ServiceTime: ServiceTimeDetail;
	}>;
}



export interface ServiceTimeForm {
	frequency: string[];
	month: string[];
	week: string[];
	everyMonth: string;
	everyWeek: string;
	time: string[];
	first: string
}

export interface ServiceTimeSubmit {
	cron: string;
	moon: {
		days: string[];
	};
	others: {
		first: string;
		moon: string;
		week: string;
	};
	time: Array<{
		start: string
		end: string
	}>;
	week: {
		days: string[]
	};
}

export interface ServiceTimeDetail {
	Cron: string;
	Moon: {
		Days: string[];
	};
	Others: {
		First: string;
		Moon: string;
		Week: string;
	};
	Time: Array<{
		Start: string
		End: string
	}>;
	Week: {
		Days: string[]
	};
}

// 服务包配置
export interface ServiceContentConfig {
	indeterminate:  boolean,
	checkAll: boolean,
	checkedList: number[],
	tagID: number
	all: number[]
	settingIdMap: Record<string, number>
}

// 服务包标签列表
export interface ServiceTagConfig {
	settingID: number;
	settingLevelID: number;
	tagID: number;
}

interface EnumItem {
	Name: string;
	ID: number;
}

// 服务包照护内容列表
export interface PackageTableColumn {
	ID: number;
	Desc: string;
	Name: string
	Level: EnumItem[]
	Tag: EnumItem[]
	Way: EnumItem[]
}

// 服务包详情
export interface PackageDetail {
	ID: number;
	Desc: string;
	Name: string
	Level: EnumItem
	Enable: number
	PackageSettings: PackageTableColumn[]
}

export interface AddServicePackageBase {
	enable: number;
	name: string;
	desc: string;
}

export interface AddServicePackage {
	levelID?: number
	packageSettings?: Array<{
		// levelID: number
		settingID: number
		tagID: number
	}>
}

export type AddService = AddServicePackageBase & AddServicePackage
